home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1998 / MacHack 1998.toast / Papers / OS Shell in Java / Facade / DesktopWindow.java < prev    next >
Encoding:
Java Source  |  1998-06-17  |  1.2 KB  |  62 lines  |  [TEXT/dosa]

  1. //    DesktopWindow.java : this is a Java source code file for the program Facade.
  2. //    Copyright 1998, Andrew S. Downs
  3. //    andrew.downs@tulane.edu
  4. //
  5. //    This source code is distributed as freeware.
  6. //    Just keep this author information in the file.  Enjoy!
  7.  
  8. import java.awt.*;
  9. import java.io.*;
  10.  
  11. public class DesktopWindow extends Window implements Serializable {
  12.     // Window title
  13.     String label;
  14.     
  15.     DesktopWindow() {
  16.         super( new Frame() );
  17.         this.setFont( new Font( "Dialog", Font.BOLD, 12 ) );
  18.     }
  19.  
  20.     public void setLabel( String s ) {
  21.         this.label = s;
  22.     }
  23.  
  24.     public String getLabel() {
  25.         return this.label;
  26.     }
  27.  
  28.     // Accessors for individual location/size values
  29.     public void setX( int i ) {
  30.         this.setLocation( i, this.getLocation().y );
  31.     }
  32.  
  33.     public int getX() {
  34.         return this.getLocation().x;
  35.     }
  36.  
  37.     public void setY( int i ) {
  38.         this.setLocation( this.getLocation().x, i );
  39.     }
  40.  
  41.     public int getY() {
  42.         return this.getLocation().y;
  43.     }
  44.  
  45.     public void setWidth( int i ) {
  46.         this.setSize( i, this.getSize().height );
  47.     }
  48.  
  49.     public int getWidth() {
  50.         return this.getSize().width;
  51.     }
  52.  
  53.     public void setHeight( int i ) {
  54.         this.setSize( this.getSize().width, i );
  55.     }
  56.  
  57.     public int getHeight() {
  58.         return this.getSize().height;
  59.     }
  60. }
  61.  
  62.